$(function(){

    window.infoWidget = function(){
        var widget = $(
                "<div class='infoColumn column'>" +
                    "<div class='column-header'><a>X</a><span>系统消息</span></div>" +
                    "<div class='column-body'></div>" +
                    "<div class='column-bottom'></div>" +
                    "</div>"),
            close = widget.find(".column-header a"),
            msgContent = widget.find(".column-body");


        $("body").append(widget);

        close.click(function(){
            show(widget, false, 300);
        });

        return {showMsg: showMsg};


        function showMsg(msg){
            msgContent.html(msg);
            show(widget, true, 300);
        }


        function log(data){
            if(console)
                console.log(data);
        };

        function show(obj,visible,duration,callback){
            if(visible)
                if($.support.opacity) {
                    obj.stop().fadeIn(duration,callback);
                }
                else{
                    obj.show();
                    if(callback) callback();
                }
            else
            if($.support.opacity) {
                obj.stop().fadeOut(duration,callback);
            }
            else{
                obj.hide();
                if(callback) callback();
            }
        }

    }();


    infoWidget.showMsg("同志你好，由于你在考试中配合他人作弊，因此你的考试成绩作废，详情请点击<a>这里</a>。啧啧啧，本来都过了呢...");

});


